package com.ethink.order.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.order.api.info.TocSaleAfterImportLogInfo;
import com.ethink.order.common.entity.TocSaleAfterImportLog;

/**
 * TOC售后导入日志 Converter转换器
 *
 * @author default
 * @date 2023-01-10
 */
@Component
public class TocSaleAfterImportLogConverter implements Converter<TocSaleAfterImportLogInfo, TocSaleAfterImportLog> {

    @Override
    public TocSaleAfterImportLog convertTo(TocSaleAfterImportLogInfo info) {
        if(info == null) {
            return null;
        }
        TocSaleAfterImportLog entity = new TocSaleAfterImportLog ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public TocSaleAfterImportLogInfo convertFrom(TocSaleAfterImportLog entity) {
        if(entity == null) {
            return null;
        }
        TocSaleAfterImportLogInfo info = new TocSaleAfterImportLogInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
